import React, {FC, PropsWithChildren, Children, ReactNode} from 'react';
import type { IComponent } from '@bastet/widgets';
import { DraggableComponent, IDraggableComponentProps } from '@bastet/widgets';
export { default as settings } from './setting';
import './grid-style.less';


interface IProps extends IDraggableComponentProps {
  settings: any;
  children: ReactNode[];
}

const GridComponent: FC<IProps> = (
  { children, settings = {}, data, className, ...props }
) => {
  console.log('Grid: => ', { children, settings, data, ...props })

  return (
    <DraggableComponent data={data} className={className} {...props}>
      { children && children.map((Child: any, index: number) => <Child key={index} dataType={index}/>) }
    </DraggableComponent>
  )
};

export default GridComponent
